/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ivanhoe
 */
@Entity
@Table(name = "currency")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Currency.findAll", query = "SELECT c FROM Currency c"),
    @NamedQuery(name = "Currency.findByIdCurrency", query = "SELECT c FROM Currency c WHERE c.idCurrency = :idCurrency"),
    @NamedQuery(name = "Currency.findByNombreCurrency", query = "SELECT c FROM Currency c WHERE c.nombreCurrency = :nombreCurrency")})
public class Currency implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_currency")
    private Integer idCurrency;
    @Size(max = 45)
    @Column(name = "nombre_currency")
    private String nombreCurrency;

    public Currency() {
    }

    public Currency(Integer idCurrency) {
        this.idCurrency = idCurrency;
    }

    public Integer getIdCurrency() {
        return idCurrency;
    }

    public void setIdCurrency(Integer idCurrency) {
        this.idCurrency = idCurrency;
    }

    public String getNombreCurrency() {
        return nombreCurrency;
    }

    public void setNombreCurrency(String nombreCurrency) {
        this.nombreCurrency = nombreCurrency;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCurrency != null ? idCurrency.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Currency)) {
            return false;
        }
        Currency other = (Currency) object;
        if ((this.idCurrency == null && other.idCurrency != null) || (this.idCurrency != null && !this.idCurrency.equals(other.idCurrency))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Currency[ idCurrency=" + idCurrency + " ]";
    }
    
}
